﻿using System;
using DapperExtensions.Mapper;

namespace ZilLion.Service.WeChatMall.Domain.Entitys.ShopInfo
{
    public class ShopBasicInfoEntity
    {
        /// <summary>
        ///     店铺id
        /// </summary>
        public long ShopId { get; set; }

        /// <summary>
        ///     纵联商城接入关键字
        /// </summary>
        public string ZlCompanyKey { get; set; }

        /// <summary>
        ///     店铺名称
        /// </summary>
        public string ShopName { get; set; }

        /// <summary>
        ///     店铺描述文案（逗号隔开）
        /// </summary>
        public string ShopInfos { get; set; }

        /// <summary>
        ///     店铺公告（逗号隔开）
        /// </summary>
        public string ShopBulletin { get; set; }

        /// <summary>
        ///     店铺得分
        /// </summary>
        public decimal ShopScore { get; set; }

        /// <summary>
        ///     店铺logo地址
        /// </summary>
        public string ShopAvatar { get; set; }

        /// <summary>
        ///     店铺备注
        /// </summary>
        public string ShopDescription { get; set; }

        /// <summary>
        ///     起送价格
        /// </summary>
        public decimal ShopMinOrderMy { get; set; }

        /// <summary>
        ///     配送费
        /// </summary>
        public decimal ShopDeliveryPrice { get; set; }

        /// <summary>
        ///     经纬度
        /// </summary>
        public string ShopLocation { get; set; }


        /// <summary>
        ///     城市编码
        /// </summary>
        public string ShopAdCode { get; set; }

        /// <summary>
        ///     address 地标地址（地图定位地址）
        /// </summary>
        public string ShopGpsAddress { get; set; }

        /// <summary>
        ///     shaddress 送货地址(用户手输的详细地址)
        /// </summary>
        public string ShopDetailAddress { get; set; }

        /// <summary>
        ///     店铺联系电话
        /// </summary>
        public string ShopPhone { get; set; }

        /// <summary>
        ///     是否是配送点
        /// </summary>
        public bool IsSendCenter { get; set; }


        /// <summary>
        ///     是否是自提点
        /// </summary>
        public bool IsSinceCenter { get; set; }

        /// <summary>
        ///     修改时间
        /// </summary>
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        ///     修改人
        /// </summary>
        public long Updater { get; set; }
    }


    public class ShopBasicInfoEntityMapper : ClassMapper<ShopBasicInfoEntity>
    {
        public ShopBasicInfoEntityMapper()
        {
            Table("shopbasicinfo");
            Map(f => f.ShopId).Column("shopid").Key(KeyType.Assigned);
            Map(f => f.ZlCompanyKey).Column("zlcompanykey");
            Map(f => f.ShopName).Column("shopname");
            Map(f => f.ShopInfos).Column("shopinfos");
            Map(f => f.ShopBulletin).Column("shopbulletin");
            Map(f => f.ShopScore).Column("shopscore");
            Map(f => f.ShopAvatar).Column("shopavatar");
            Map(f => f.ShopDescription).Column("shopdescription");
            Map(f => f.ShopMinOrderMy).Column("shopminordermy");
            Map(f => f.ShopDeliveryPrice).Column("shopdeliveryprice");
            Map(f => f.ShopLocation).Column("shoplocation");
            Map(f => f.ShopAdCode).Column("shopadcode");
            Map(f => f.ShopGpsAddress).Column("shopgpsaddress");
            Map(f => f.ShopDetailAddress).Column("shopdetailaddress");
            Map(f => f.UpdatedTime).Column("updatedtime");
            Map(f => f.Updater).Column("updater");
            Map(f => f.IsSendCenter).Column("issendcenter");
            Map(f => f.IsSinceCenter).Column("issincecenter");
            Map(f => f.ShopPhone).Column("shopphone");
        }
    }
}